<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>  
<script type="text/javascript"
	src='<c:url value="/resources/js/profit/searchResult.js"/>'></script>

<c:if test="${empty pagingBean.data }">	
<p class="msg info">没有符合条件的记录</p>
</c:if>
<c:if test="${!empty pagingBean.data }">	
<table>
<tbody>
	<tr>
		<th>
			会员卡号
		</th>
		<th>
			会员姓名
		</th>
		<th>
			建卡时间
		</th>
		<th>
			身份证
		</th>
		<th>
			联系电话
		</th>
		<th>
			操作员
		</th>
		<th>
			当天返利金额
		</th>
		<th>
			已返还金额
		</th>
		<th>
			返利目标金额
		</th>
		<th>
			还剩金额
		</th>
	</tr>
	<c:forEach items="${pagingBean.data }" var="member"
		varStatus="status">
		<c:if test="${status.count%2==0}">
			<c:if test="${member.remainAmount ==0.0 }">
				<tr class="tg" style="color: red">
			</c:if>
			<c:if test="${member.remainAmount !=0.0 }">
				<tr class="tg">
			</c:if>
		</c:if>
		<c:if test="${status.count%2!=0}">
			<c:if test="${member.remainAmount ==0.0 }">
				<tr style="color: red">
			</c:if>
			<c:if test="${member.remainAmount !=0.0 }">
				<tr class="tg">
			</c:if>
		</c:if>
		<td>
			<a href="#" onclick="viewReturnHistory(${member.id })">
				${member.memberCardNumber }
			</a>
		</td>
		<td>
			${member.name }
		</td>
		<td>
			${member.createDateString }
		</td>
		<td>
			${member.idCardNumber }
		</td>
		<td>
			${member.phoneNumber }
		</td>
		<td>
			${member.operatorName }
		</td>
		<td>
			${member.todayReturnAmount }
		</td>
		<td>
			${member.returnedAmount }
		</td>
		<td>
			${member.targetProfitAmount }
		</td>
		<td>
			${member.remainAmount }
		</td>
		</tr>
	</c:forEach>
	<tr>
		<th colspan="14" class="t-right">
			<c:if test="${pagingBean.hasPreviousPage }">
				<input id="previousButton" type="button" value="上一页">
				<input id="previousPageIndex" type="hidden" value="${pagingBean.previousPage}">
			</c:if>
			<c:if test="${!pagingBean.hasPreviousPage }">
				<input id="previousButton" type="button" disabled="disabled" value="上一页">
			</c:if>
			<input id="currentPageIndex" type="hidden" value="${pagingBean.afterDeletePage}">
			<select name="pageIndex" id="pageSelection">
				<c:if test="${empty pagingBean.data }">
					<option selected="selected" value="1">
						第1页
					</option>
				</c:if>
				<c:if test="${!empty pagingBean.data }">
					<c:forEach items="${pagingBean.pageIndexList }" var="index">
						<c:if test="${index==pagingBean.currentPage }">
							<option selected="selected" value="${index }">
								第${index }页
							</option>
						</c:if>
						<c:if test="${index!=pagingBean.currentPage }">
							<option value="${index }">
								第${index }页
							</option>
						</c:if>
					</c:forEach>
				</c:if>
			</select>
			<c:if test="${pagingBean.hasNextPage }">
				<input id="nextButton" type="button" value="下一页">
				<input id="nextPageIndex" type="hidden" value="${pagingBean.nextPage}">
			</c:if>
			<c:if test="${!pagingBean.hasNextPage }">
				<input id="nextButton" type="button" disabled="disabled" value="下一页">
			</c:if>
		</th>
	</tr>
	</tbody>
</table>
</c:if>